package gang.org.springframework.framework.core.annotation;

import gang.org.springframework.framework.annotation.GangPackagesAnnotationFilter;

import java.lang.annotation.Annotation;

@FunctionalInterface
public interface GangAnnotationFilter {


    GangAnnotationFilter PLAIN = packages("java.lang","org.springframework.lang");

    default boolean matches(Annotation annotation){
        return matches(annotation.annotationType());
    }

    default boolean matches(Class<?> type) {
        return matches(type.getName());
    }



    boolean matches(String typeName);

    static GangAnnotationFilter packages(String... packages){
        return new GangPackagesAnnotationFilter(packages);
    }
}
